package com.design.singleton;

/**
 * 饿汉模式，在类装载时创建，是线程安全的
 */
public class SingletonExample2 {
    public SingletonExample2(){};
    private SingletonExample2 instance = new SingletonExample2();

    public SingletonExample2 getInstance(){
        return instance;
    }
}
